package com.company.笔试.长度超过一般的字符;// 本题为考试单行多行输入输出规范示例，无需提交，不计分。
import java.util.*;
public class Main {
    private static int a = 1;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String sin = in.nextLine();
        String[] sarr = sin.split(",");
        int len = sarr.length;
        int helf = len / 2;
        HashMap<String,Integer> map = new HashMap<>();
        for(String ss : sarr){
            if(map.containsKey(ss)){
                map.put(ss,map.get(ss)+1);
            }else{
                map.put(ss,1);
            }
        }
        ArrayList<Integer> arrayList =new ArrayList<>();
        map.entrySet().forEach(
                (entry)->{
                    if(entry.getValue()>helf){
                        System.out.print(entry.getKey());
                        a = 2;
                        arrayList.add(1);
                    }

                });

        try{
            map.entrySet().forEach(
            (entry)->{
                if(entry.getValue()>helf){
                System.out.print(entry.getKey());
                int a = 1/0;
                }
                
              });
        }catch (Exception e){
            return;
        }
        System.out.print("0");
        
    }
}